#
# Copyright (C) [2024] Xingyun Integrated Circuit, Inc.
#
# GreenCode was a private technology asset of Xingyun Integrated Circuit， Inc （Confidential） (the "License");
#  Author: Shawn.Tan
#  Date : 2025.10.28
#
# History: Initial Version 2025.10.28
#
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR
# FIT FOR A PARTICULAR PURPOSE.
# See the License for the specific language governing permissions and
# limitations under the License.
#
from gpgpu.EnvGPGPU import EnvGPGPU
from gpgpu.GenThreadGPGPU import GenThreadGPGPU
from base.Sequence import Sequence


class MainSequence(Sequence):
    def generate(self, **kargs):
        rand_PA = self.genPA(Size=8, Align=8, Type="D", Bank="Default", CanAlias=1)
        rand_VA_1 = self.genVAforPA(PA=rand_PA, Bank="Default", FlatMap=0, Type="D", Size=8)
        rand_VA_2 = self.genVAforPA(
            PA=rand_PA,
            Bank="Default",
            FlatMap=0,
            Type="D",
            Size=8,
            ForceNewAddr=1,
        )

        self.genInstruction("SD##CALM", {"LSTarget": rand_VA_1})
        self.genInstruction("LD##CALM", {"LSTarget": rand_VA_2})


MainSequenceClass = MainSequence
GenThreadClass = GenThreadGPGPU
EnvClass = EnvGPGPU
